$(document).ready(function () {
        $.ajax({
            url: "OperationInfoServlet",
            type: "POST",
            async: true,
            catch: false,
            dataType: "json",//表示请求的返回数据格式{"username":"sss","password":"111"}
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            data: {},
            success: function (data) {//回调函数
                for (var i = 0; i < data.length; i++) {
                    if (data[i] == null || data[i] == "") {
                        continue;
                    }
                    var info1 = data[i].operationinfo1.substring(0, data[i].operationinfo1.lastIndexOf("息") + 1);
                    var time1 = data[i].operationinfo1.substring(data[i].operationinfo1.lastIndexOf("息") + 1);
                    console.log("opeation1:" + info1 + time1);
                    if (data[i].operationinfo2 != undefined) {
                        var info2 = data[i].operationinfo2.substring(0, data[i].operationinfo2.lastIndexOf("息") + 1);
                        var time2 = data[i].operationinfo2.substring(data[i].operationinfo2.lastIndexOf("息") + 1);
                    }

                    $(".operationimg").eq(i).attr("src", data[i].headimg);
                    $(".logintime").eq(i).html("<span style='color: red'>" + "登录系统" + "</span>" + "<span class='timespan'>" + data[i].logintime + "</span>");
                    $(".info1").eq(i).html(info1 + "<span class='timespan2'>" + time1 + "</span>");
                    console.log("opeation2:" + info2 + time2)
                    if (data[i].operationinfo2 != undefined) {
                        $(".info2").eq(i).html(info2 + "<span class='timespan2'>" + time2 + "</span>");
                    }
                }
            },
            error: function () {
                alert("请求失败")
            }

        })
    }
)